// pages/order_mangement/order_mangement.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currentindex:0,
      con1:[],
      con2:[],
      con3:[],
      con4:[],
      con5:[],
      con6:[],
      con7:[]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options);
    console.log(options.state);
    this.setData({
      currentindex:options.state,
    })
    if (options.con1 != undefined) {
      this.setData({
        con1:JSON.parse(options.con1)
      })
      console.log(JSON.parse(options.con1));
    }
    // console.log(options.con2);
    if (options.con2 != undefined) {
      // console.log(JSON.parse(options.con2));
      this.setData({
        con2:JSON.parse(options.con2)
      })
    }
    if (options.con3 != undefined) {
      console.log(JSON.parse(options.con3));
      this.setData({
        con3:JSON.parse(options.con3)
      })
    }
    if (options.con4 != undefined) {
      console.log(JSON.parse(options.con4));
      this.setData({
        con4:JSON.parse(options.con4)
      })
    }
    if (options.con5 != undefined) {
      console.log(options.con5);
      console.log(JSON.parse(options.con5));
      this.setData({
        con5:JSON.parse(options.con5)
      })
    }
    if (options.con6 != undefined) {
      console.log(JSON.parse(options.con6));
      this.setData({
        con6:JSON.parse(options.con6)
      })
    }
    if (options.con7 != undefined) {
      console.log(JSON.parse(options.con7));
      this.setData({
        con7:JSON.parse(options.con7)
      })
    }


  },
  return(){
    wx.switchTab({
      url: '../usercenter/usercenter',
    })
  },
  topay(e){
    let data = e.currentTarget.dataset.item;
    console.log(data);
    let arr =[];
    let obj = {};
    obj.img = data.img;
    obj.good_name = data.good_name;
    obj.price = data.price;
    arr.push(obj)
    console.log(data.address_id);
     wx.navigateTo({
       url: '../order/order?address_id='+data.addres_id+"&money="+data.money+"&shopping_cars_ids="+ JSON.stringify(arr),
     })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})